<template>
  <div class="flex-x flex-space w100">
    <el-form
      label-width="80px"
      :inline="true"
      :model="form"
      class="demo-form-inline"
      size="small"
    >
      <el-form-item label="批次号:" prop="partNumber">
        <el-input
          class="dark_input"
          v-model="form.partNumber"
          placeholder="请输入"
        ></el-input>
      </el-form-item>
      <el-form-item label="零件号:" prop="batchNumber">
        <el-input
          class="dark_input"
          v-model="form.batchNumber"
          placeholder="请输入"
        ></el-input>
      </el-form-item>
      <el-form-item label="时间:" prop="startDate">
        <div class="flex-x">
          <el-date-picker
            class="w100 dark_input"
            v-model="form.startDate"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            size="small"
            placeholder="开始日期"
          ></el-date-picker>
          <i class="el-icon-right" style="color: rgba(0, 0, 0, 0.25)"></i>
          <el-date-picker
            size="small"
            class="w100 dark_input"
            v-model="form.endDate"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="结束日期"
          ></el-date-picker>
        </div>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" size="small" @click="onSubmit"
          >查 询</el-button
        >
        <el-button size="small" @click="handleReset">重 置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { currentDate3 } from "@/utils/currentDate";
export default {
  props: {},
  data() {
    return {
      form: {
        startDate: "",
        endDate: "",
        batchNumber: "",
        partNumber: ""
      }
    };
  },
  methods: {
    onSubmit() {
      this.$emit("onSubmit", {
        startDate: this.form.startDate,
        endDate: this.form.endDate,
        batchNumber: this.form.batchNumber,
        partNumber: this.form.partNumber
      });
    },
    handleReset() {
      Object.assign(this.$data.form, this.$options.data().form);
      this.$emit("onSubmit");
    }
  }
};
</script>
<style lang="scss" scoped></style>
